package responsibilitychain;

/**
 * @author chenyuan
 * @date 2020/10/30 16:48
 */
public class ViceSchoolMasterApprover extends Approver {
    public ViceSchoolMasterApprover(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest purchaseRequest) {
        if (purchaseRequest.getPrice() > 10000
                && purchaseRequest.getPrice() <= 30000){
            // 满足要求改处理者处理
            System.out.println("== 请求编号 id = "+purchaseRequest.getId()
                    +"被 " + this.name +"处理了");
        }else{// 不满足要求传递给下一个
            approver.processRequest(purchaseRequest);
        }
    }
}
